package pers.cj.pdos.service;

import pers.cj.pdos.entity.Company;
import pers.cj.pdos.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.UserHouse;
import pers.cj.pdos.entity.UserRole;
import pers.cj.pdos.vo.UserVo;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface IUserService extends IService<User> {
    User getById(String id);
    User getByUsername(String username);

    User getAdminByCompany(Company company);

    UserVo getVoById(String id);
    UserVo getVoByUserName(String userName);

    /**
     * 检查是否被使用过
     * @param id
     * @return
     */
    boolean check(String id);

    List<UserVo> listVoPage(Integer page, Integer limit, String companyId, String searchStoreId, String searchContent, Integer status);

    long count(String companyId, String searchStoreId, String searchContent, Integer status);

    void insert(User user, List<UserRole> userRoleList, List<UserHouse> userHouseList);

    void update(User user, List<UserRole> userRoleList, List<UserHouse> userHouseList);

    boolean checkUsername(String username);

    void remove(User user);

    boolean exist(String id);
}
